<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<link rel="stylesheet" href="/assets/layui/css/layui.css"/>
<script src="/assets/layui/layui.js"></script>

 
<script>
      var window_box;
    layui.use(['table', 'layer', 'laydate', 'form'], function(){
        var layer = layui.layer,
            $ = layui.jquery,
            table = layui.table,
            laydate = layui.laydate,
            form = layui.form;

        //时间插件
        laydate.render({
            elem: '#date',
            range: '到',
            format: 'yyyy-MM-dd'
        });
})
</script>


<table class="layui-table">
            <colgroup>
              <col width="150">
              <col width="200">
              <col>
            </colgroup>
            <thead>
              <tr>
                <th class="thsort" data-field="id">ID</th>
                <th class="thsort"  >订单号 </th>
                <th class="thsort"  >用户名</th>                
                <th class="thsort"  >城市</th>
                <th class="thsort"  >类型</th>
                <!-- <th class="thsort"  >备注</th> -->
                <th class="thsort"  >订单金额</th>
                <th class="thsort"  >订单时间</th>
                <th class="thsort" >订单状态</th>
                <th class="thsort" >联系方式</th>
                <!-- <th class="thsort"  >订单地址</th> -->
                <th>操作</th>
              </tr> 
            </thead>

            
            <tbody>
                    {if condition="$count eq 0"}
                    <tr class="text-c"><td colspan="12" style="text-align: center;">暂无相关数据</td></tr>
                {else/}
                    {foreach name="list" item="vo"}
                    <tr>
                        <!-- <td><input type="checkbox" name="id[]" value="{$vo.id}" />{$vo.id}</td> -->
                        <td>{$vo.id}</td> 
                        <td>{$vo.order_num}</td>                     
                        <td>{$vo.nickname}</td>
                        <td>{$vo.areaname}</td>
                        <td>{$vo.service_name}</td>
                        <!-- <td>{$vo.remake}</td> -->
                        <td>{$vo.money}</td>
                        <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                        <td> {if( condition="($vo['status']) eq '2' "}已完成
                                {elseif condition="($vo['status']) eq '3' "}取消订单
                                 {else/} 
                                 {/if}</td>
                        <td>{$vo.mobile}</td>
                        <!-- <td>{$vo.address}</td> -->
                        <td>  
                           <a href="#" onclick="seek({$vo.id})"> <span class="layui-badge layui-bg-green">查看</span> </a>        
                           
                        </td>
                        </tr>
                    {/foreach}
                {/if}
                </tbody>
            </table>
            <!--分页开始-->
            <div style="padding-top:15px;float: right; ">
                <!--<div class="page"></div>-->
                {$page}
            </div>
            <script>
            
        function seek(id){
           layer.open({
             type: 2,
             shadeClose: true,
             maxmin: true, 
             title:'查看',
             shade: 0.3,
             area: ['893px', '600px'],
             content: '/public/admin/ordermanagement/seek/?id='+id

   });
          
} 

var order = 'desc';
var field = 'id';

 
// 排序
 
    // $(".layui-table").on('click', '.thsort', function(event) {
    //     event.preventDefault();
    //     /* Act on the event */
    //     // 获取排序方式
 
    //     field=$('table>tbody>tr>td:nth-child(1)').text();

    //     // field = $(this).data("field");
    //     // alert(field);return;
    //     if (order == 'desc') {
    //        order = "asc";
    //     } else if (order == 'asc') {
    //        order = "desc";
    //     }
    //     console.log(field);
    //     // alert(order);
 
    //     $.post('{:url("sort")}', {field: field, sort: order}, function(data, textStatus, xhr) {
    //         /*optional stuff to do after success */
    //         // console.log(data);
    //         $('.layui-table').html(data);
    //     });
    // });
 

  
         </script>

 